package com.easy.mapper;

import com.easy.bean.User;
import com.easy.util.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Mapper
@RequestMapping("/user")
public interface UserMapper {

    int add(@Param("user") User user) ;
    int del(@Param("id") Integer id) ;
    int edit(@Param("user") User user) ;
    User one(@Param("id") Integer id) ;
    List<User> all(@Param("user") User user) ;

    //这两个的@Param("param")参数名是要求必须一样的，否则报错
    int pageCount(@Param("param") User user) ;
    List<User> page(@Param("page") Page page,@Param("param") User user) ;

    String getoldPasswordById(@Param("id")Integer id);

//通过电话获取
    User getByPhone(@Param("phone") String phone) ;
//更新密码
    void updatePassword(@Param("password") String password,@Param("id") Integer id) ;
    void updateEmailCaptcha(@Param("emailCaptcha") String emailCaptcha,@Param("id") Integer id) ;
//获取所有图片url
    List<String> getAllImgUrls();
}
